﻿using System.Windows.Forms;

namespace Ensemble_Windows.UI.PictureBox
{
    /// <summary>
    ///     Picture帮助类
    /// </summary>
    public class PictureHelper
    {
        /// <summary>
        ///     创建PictureBox
        /// </summary>
        /// <returns>PictureBox</returns>
        public static PictureBox Create()
        {
            return new PictureBox();
        }

        /// <summary>
        ///     创建PictureBox
        /// </summary>
        /// <param name="form">Form窗体</param>
        /// <returns>PictureBox</returns>
        public static PictureBox Create(Form form)
        {
            var pic = new PictureBox();
            form.Controls.Add(pic);
            return pic;
        }

        /// <summary>
        ///     创建PictureBox
        /// </summary>
        /// <param name="control">Cotrnol</param>
        /// <returns>PictureBox</returns>
        public static PictureBox Create(Control control)
        {
            var pic = new PictureBox();
            control.Controls.Add(pic);
            return pic;
        }
    }
}